var ffmpeg = require('fluent-ffmpeg');
var inputPath = './files/lmn/27ID-009/27ID009C.mkv';
var outputPath = 'rtmp://localhost/live/test112';

var command2 = ffmpeg(inputPath)
    .inputOptions('-re')
    .format('flv')
    .seekInput('10:00')
    .size('200%')
    .on("start", function(commandLine){
        //commandLine 为实际上调用的命令行命令,拼接逻辑为
        //您的ffmpeg所在路径 -i inputOptions 您的拉流协议和路径 outputOptions 推送流协议和地址
        //ffmpeg -i "rtsp://yourPullUrl" -f flv -r 25 -s 640x480 -an "rtmp://yourPushUrl"
        console.log('[' + new Date() + '] Vedio is Pushing !');
        console.log('[' + new Date() + '] Spawned Ffmpeg with command !');
        console.log('[' + new Date() + '] Command: ' + commandLine);
    })
    .on('error', function(err, stdout, stderr) {
        console.log('error: ' + err.message);
        console.log('stdout: ' + stdout);
        console.log('stderr: ' + stderr);
    })
    .on('end', function() {
        console.log('[' + new Date() + '] Vedio Pushing is Finished !');
    })
    .output(outputPath)
    .run();